feat(opencode): add killswitch indicators to TUI sidebar#39
Open
iceteaSA wants to merge 5 commits into
Open
Conversation
There was a problem hiding this comment.
2 issues found across 16 files
Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.
Fix all with cubic | Re-trigger cubic
84f44e5 to
583586a
Compare
|
No dependency changes detected. Learn more about Socket for GitHub. 👍 No dependency changes detected in pull request |
e747750 to
2b2c0e3
Compare
Unified quota cache and API gateway for main + fallback quota state. All consumers share one QuotaManager instance for consistent caching. Features: - Inflight deduplication prevents concurrent API calls - Exponential backoff (60s-15min) for 429/5xx errors - Persists main quota and backoff state to disk via callbacks - Cross-process file lock guard for quota API dedup - Seeds from persisted storage on construction - Integrates with FallbackAccountManager for shared staleness - Captures storage path at init to prevent test config corruption - Request-count-based refresh trigger (refreshEveryNRequests)
2b2c0e3 to
09b34c3
Compare
Adds a TUI sidebar widget showing real-time quota usage for main and fallback accounts. Displays usage bars, reset times, relay status, fast mode, and cache-keepalive state. New files: sidebar-state.ts, tui.tsx, scripts/copy-tui.mjs Modified: package.json (TUI deps, exports), index.ts (writeSidebarState)
…reshold Per-account request blocking when remaining quota drops below configurable thresholds. Returns synthetic 429 when all accounts (main + fallbacks) are below their thresholds. Includes /claude-killswitch slash command for runtime management. Features: - Per-account threshold overrides (5h and 7d windows) - Eager quota refresh on first request for killswitch evaluation - Skip-main routing when main is killed (try surviving fallbacks) - Filter killed accounts from reactive fallback path - Retry-After header with earliest quota reset time
Shows killed account status (red dot), quota/refresh backoff state, and kill summary in the sidebar widget.
09b34c3 to
8339edc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds killswitch awareness to the TUI sidebar widget:
writeSidebarState()computes killswitch policy for all accountsFiles:
packages/opencode/src/sidebar-state.ts— addskilled, backoff fieldspackages/opencode/src/tui.tsx— killed indicator, kill status sectionpackages/opencode/src/index.ts— killswitch-aware sidebar stateSummary by cubic
Adds killswitch status to the TUI sidebar and introduces a shared core
QuotaManagerfor real-time quota/backoff with persistence and cross-process dedupe. Also writes a sidebar state file and exposes./tuiso the UI can render without extra fetches.QuotaManager: unified cache for main+fallbacks, inflight dedupe, exponential backoff (60s–15m), persisted main quota/backoff, cross-process file lock, request-count-based refresh, seeds from storage, integrates withFallbackAccountManager.writeSidebarState()persists killswitch/quota/backoff for main and fallbacks and includes tracked session count for cache-keepalive./claude-killswitchto view/enable/disable and set thresholds; exports TUI via@cortexkit/opencode-anthropic-auth./tui, copiestui.tsxat build, and registers both entries inoc-plugin.Written for commit 8339edc. Summary will update on new commits. Review in cubic